import request  from '@/utils/request';

import { TEMP_URL, BASE_URL } from '@/config/query';

export async function queryPage(params) {
  return request(`${TEMP_URL}/device/page`, { ...params, kind: '99' })
}

export async function queryInfoById(id) {
  return request(`${TEMP_URL}/device/detail/${id}`)
}

export async function create(params) {
  return request(`${TEMP_URL}/device/create`, { ...params, kind: '99' })
}

export async function update(params) {
  return request(`${TEMP_URL}/device/modify`, params)
}

export async function remove(id) {
  return request(`${TEMP_URL}/device/remove/${id}`)
}

export async function queryLocation({ tail, ...res }) {
  return request(`${BASE_URL}/${tail}/list`, res)
}

export async function queryBrand({ tail, ...res }) {
  return request(`${BASE_URL}/${tail}/list`, res)
}

export async function queryFloorById(id) {
  return request(`${BASE_URL}/floor_plan/detail/${id}`)
}
